package com.zcf.service;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.zcf.common.json.Body;
import com.zcf.mapper.AirlinesMapper;
import com.zcf.pojo.Airlines;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author ： jsq
 * @date ：2019/10/13 22:24
 * @description : 客服
 * @path : com.ggh.service.impl.RoomRecordServiceImpl
 * @modifiedBy ：
 */
@Service
public class AirlinesServiceImpl  {
    /**
    * @description :添加客服
    * @return: boolean
    * @date : 2019/10/14 15:15
    * @author : jj
    * @throws
    */
    @Transactional(rollbackFor = Exception.class)
    public Body add(Airlines airlines){
        boolean insert = airlines.insert();
        return Body.newInstance();
    }

    @Transactional(rollbackFor = Exception.class)
    public Body delete(Airlines airlines) {
        boolean delete = airlines.delete(new EntityWrapper<Airlines>().eq("name", airlines.getName()).eq("wx", airlines.getWx()));
        if (delete) {
            return Body.newInstance();
        } else {
            return Body.newInstance(500, "删除失败");
        }
    }
}
